
#include "CommonString.h"


CString Bytes2CString(const ByteBuffer& buff)
{
	tstring	s((TCHAR*)buff.c_str(),buff.size()*sizeof(char)/sizeof(TCHAR));
	return s.c_str();
}

ByteBuffer CString2Bytes(const CString& s)
{
	ByteBuffer	buff((char*)(LPCTSTR)s,s.GetLength()/sizeof(char)*sizeof(TCHAR));
	ByteBuffer  buff2;
	buff2.append(buff);
	return buff2;
}


CString  string2CString(const std::string& buff)
{
	return Bytes2CString(buff);
}


std::string  CString2string(const CString& s)
{
	return CString2Bytes(s);
}